// 在对应的注释下配置，注意注释
// 通用
import { hasIn } from 'lodash'
import { getCertificate } from '@const/productCenterApiV2'
import { formatDate, getFormatterPrice } from '@const/filter.js'
export function regisNoButton (data, id = 'registrationNumberId', number = 'registrationNumber') {
  if (data[number]) {
    return data[number]
  } else if (!data[number] && data[id]) {
    return '暂无注册证号'
  } else if (!data[number] && !data[id]) {
    return '暂无数据'
  }
}
// 查看注册证
export function showPdfRegistion (id) {
  this.$axios({
    method: 'get',
    url: getCertificate,
    params: {
      id: id
    }
  }).then(res => {
    let obj = hasIn(res, 'data.payload') ? res.data.payload : {}
    let url = obj.pictureUrl
    if (!url) {
      this.$message({
        type: 'warning',
        message: '获取失败，请在产品管理中维护该产品的注册证信息'
      })
    } else {
      this.$pdfViewer({ url, title: '注册证预览' })
    }
  })
}
// 产品大类
export const PRODUCT_CATEGORY = {
  1: '高值',
  2: '低值',
  3: '试剂',
  4: '设备',
  5: '低值'
}
export const ORDER_STATUS_TEXT = {
  1: '待供应商响应',
  2: '待收货',
  3: '部分收货',
  4: '全部发货',
  5: '已完成',
  6: '已拒绝',
  7: '已撤销',
  8: '待验收',
  9: '待验收',
  10: '待供应商发货',
  11: '待提交'
}
// 列表
export const releasecolumns = [
  {
    prop: 'orderCode',
    label: '采购单号',
    width: 200
  },
  {
    prop: 'prodTypeCount',
    label: '品种数',
    width: 90,
    'show-overflow-tooltip': true
  },
  { prop: 'orderDetailCount', label: '产品数量', width: 90 },
  {
    prop: 'orderTotalAmount',
    label: '订单金额（元）',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.orderTotalAmount || 0)
  },
  {
    prop: 'receiveAddress',
    label: '收货地址',
    'Width': 200,
    'show-overflow-tooltip': true
  },
  { prop: 'concatMan', label: '联系人', width: 130 },
  { prop: 'concatPhone', label: '联系电话', width: 140 },
  {
    prop: 'supplierName',
    label: '供应商',
    width: 160,
    'show-overflow-tooltip': true
  },
  {
    prop: 'createdAt',
    label: '创建时间',
    width: 160
  },
  {
    prop: 'orderStatus',
    label: '订单状态',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => ORDER_STATUS_TEXT[row.orderStatus]
  },
  {
    prop: 'ops',
    label: '操作',
    width: 160,
    fixed: 'right'
  }
]

export const tabList = [

  {
    val: 11,
    lab: '待提交',
    badge: { value: null }
  },
  {
    val: 1,
    lab: '待供应商响应', // 1
    badge: { value: null }
  },
  {
    val: 10,
    lab: '待供应商发货',
    badge: { value: null }
  },
  {
    val: 2,
    lab: '待收货',
    badge: { value: null }
  },
  {
    val: 3,
    lab: '部分收货',
    badge: { value: null }
  },

  // {
  //   name: 1,
  //   lab: '待确认'
  // },
  {
    val: 5,
    lab: '已完成',
    badge: { value: null }
  },
  {
    val: 7,
    lab: '已撤销',
    badge: { value: null }
  },
  {
    val: 6,
    lab: '已拒绝',
    badge: { value: null }
  },
  {
    val: 0,
    lab: '全部',
    badge: { value: null }
  }

]
export const detailTabList = [
  {
    lab: '订单信息',
    value: 0,
    disabled: null
  },
  {
    lab: '收货信息',
    value: 1,
    disabled: null
  }
]
// 详情
export const statusmap = {
  1: '待确认',
  2: '待收货',
  3: '部分收货',
  4: '已完成',
  5: '待术后还回',
  6: '已取消',
  8: '待收货',
  9: '待收货'
}
// 详情头部信息
export const TOP_INFO = [
  {
    key: 'orderCode',
    value: '发货单号'
  },
  {
    key: 'hospitalOrderCode',
    value: '配送商订单编号'
  },
  {
    key: 'orderStatus',
    value: '订单状态'
  },
  {
    key: 'createdAt',
    value: '下单时间'
  },
  {
    key: 'hospitalName',
    value: '医疗机构'
  },
  // {
  //   key: 'prodTypeCount',
  //   value: '品规数'
  // },
  {
    key: 'receiveAddress',
    value: '寄售地址'
  },
  {
    key: 'linkMan',
    value: '联系人'
  },
  {
    key: 'linkPhone',
    value: '联系电话'
  },
  {
    key: 'orderTotalAmount',
    value: '订单金额'
  }
]
// (待确认,已取消,待收货,已拒绝详情)
export const headerConfirmedColumns = [
  {
    label: '发货单号',
    key: 'orderCode'
  },
  {
    label: '医院订单编号',
    key: 'hospitalOrderCode'
  },
  {
    label: '订单状态',
    key: 'orderStatus'
  },
  {
    label: '订单提交时间',
    key: 'createdAt'
  },
  {
    label: '供应商',
    key: 'supplierName'
  },
  // {
  //   label: '品规数',
  //   key: 'prodTypeCount'
  // },
  // {
  //   label: '总数量',
  //   key: 'orderDetailCount'
  // },
  {
    label: '收货地址',
    key: 'receiveAddress'
  },
  {
    label: '联系人',
    key: 'linkMan'
  },
  {
    label: '联系电话',
    key: 'linkPhone'
  }
]
// (部分收货详情)
export const headerPartialCollectionColumns = [
  [{
    label: '采购单号',
    key: 'orderCode'
  },
  {
    label: '订单状态',
    key: 'orderStatus'
  },
  {
    label: '创建时间',
    key: 'createdAt'
  }],
  [{
    label: '供应商',
    key: 'supplierName'
  },
  {
    label: '收货地址',
    key: 'receiveAddress'
  },
  {
    label: '联系人',
    key: 'concatMan'
  }],
  [{
    label: '联系电话',
    key: 'concatPhone'
  }]
]
export const partialCollectionColumns = [
  [{
    label: '采购单号',
    key: 'orderCode'
  },
  {
    label: '关联订单号',
    key: 'purchaseCompanyId'
  },
  {
    label: '订单状态',
    key: 'orderStatus'
  }],
  [{
    label: '创建时间',
    key: 'createdAt'
  },
  {
    label: '供应商',
    key: 'supplierName'
  },
  {
    label: '收货地址',
    key: 'receiveAddress'
  }],
  [{
    label: '联系人',
    key: 'concatMan'
  },
  {
    label: '联系电话',
    key: 'concatPhone'
  }]
]
// 已完成详情
export const headerCompletedColumns = [
  {
    label: '采购订单编号',
    key: 'orderCode'
  },
  //   {
  //   label: '平台订单编号',
  //   key: 'purchaseOrderCode'
  // },
  {
    label: '医院订单编号',
    key: 'externlCode'
  },
  {
    label: '订单状态',
    key: 'orderStatus'
  },
  {
    label: '订单提交时间',
    key: 'createdAt'
  },
  {
    label: '供应商',
    key: 'supplierName'
  },
  // {
  //   label: '品规数',
  //   key: 'productSpecCount'
  // },
  // {
  //   label: '总数量',
  //   key: 'orderDetailCount'
  // },
  {
    label: '已实收数量',
    key: 'receiveNum'
  },
  {
    label: '质检退回数量',
    key: 'returnAmount'
  },
  {
    label: '待收数量',
    key: 'awaitReceiveNum'
  },
  {
    label: '收货地址',
    key: 'receiveAddress'
  },
  {
    label: '联系人',
    key: 'linkMan'
  },
  {
    label: '联系电话',
    key: 'linkPhone'
  }
]
export const receivingGoodsDetail = [
  {
    label: '收货单号',
    key: 'receiveCode'
  },
  {
    label: '收货时间',
    key: 'createdAt'
  },
  {
    label: '收获单数量',
    key: 'purchaseNumCount'
  },
  {
    label: '实际收获数量',
    key: 'receiveNumCount'
  }
]
// 详情列表 (待确认,已取消,待收货,已拒绝)
export const detailConfirmedColumns = [
  { type: 'index', label: '序号', width: 80 },
  {
    prop: 'orderItemCode',
    label: '订单明细编号',
    'min-width': 200,
    'show-overflow-tooltip': true
  },

  {
    prop: 'itemCode',
    label: '产品编码',
    'min-width': 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'registrationNumber',
    label: ' 注册证号/备案证号',
    width: 170
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'purchaseNum',
    label: '数量',
    width: 80
  },
  {
    prop: 'unit',
    label: '最小单位',
    width: 100
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  {
    prop: 'provinceProductCode',
    label: '省平台编码',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'platCode',
    label: '平台产品编码',
    width: 150
  }
  // {
  //   prop: 'storageCondition',
  //   label: '存储条件',
  //   'min-width': 120
  // }
]
// 详情列表 (部分收货)lxy
export const detailPartialCollectionColumns = [
  { type: 'index', label: '序号', width: 80 },
  {
    prop: 'orderItemCode',
    label: '采购明细编号',
    width: 200,
    'show-overflow-tooltip': true
  },
  {
    prop: 'itemCode',
    label: '产品编码',
    width: 200,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'unit',
    label: '最小单位',
    width: 100
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 180
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  {
    prop: 'purchaseNum',
    label: '采购数量',
    width: 80
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  {
    prop: 'platCode',
    label: '平台产品编码',
    width: 150
  }
  // {
  //   prop: 'receiveNum',
  //   label: '已收货数量',
  //   width: 120,
  //   'show-overflow-tooltip': true
  // formatter: row => row['receiveNum'] + `/箱`
  // formatter: row => `${row.receiveNum && row.unit ? `${row.receiveNum}/${row.unit}` : row.receiveNum || row.unit ? row.receiveNum || '' : ''}`
  // },
  // {
  //   prop: 'awaitReceiveNum',
  //   label: '待收货数量',
  //   width: 120
  // formatter: row => row['awaitReceiveNum'] + `/箱`
  // formatter: row => `${row.awaitReceiveNum && row.unit ? `${row.awaitReceiveNum}/${row.unit}` : row.awaitReceiveNum || row.unit ? row.awaitReceiveNum || '' : ''}`
  // }
]
// 详情列表 (已完成)
export const detailCompletedColumns = [
  { type: 'index', label: '序号', width: 80 },
  {
    prop: 'orderItemCode',
    label: '订单明细编号',
    width: 200,
    'show-overflow-tooltip': true
  },

  {
    prop: 'nameCn',
    label: '产品名称',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'itemCode',
    label: '产品编码',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 120
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'purchaseNum',
    label: '数量',
    width: 80
  },
  {
    prop: 'unit',
    label: '最小单位',
    width: 100
  },
  {
    prop: 'receiveNum',
    label: '实际收货数量',
    width: 120,
    'show-overflow-tooltip': true
    // formatter: row => row['receiveNum'] + `/箱`,
    // formatter: row => `${row.receiveNum && row.unit ? `${row.receiveNum}/${row.unit}` : row.receiveNum || row.unit ? row.receiveNum : ''}`
  },
  {
    prop: 'returnNum',
    label: '质检退回数量',
    width: 120,
    'show-overflow-tooltip': true
    // formatter: row => row['returnNum'] + `/箱`
    // formatter: row => `${row.returnNum && row.unit ? `${row.returnNum}/${row.unit}` : row.returnNum || row.unit ? row.returnNum : ''}`
  },
  {
    prop: 'awaitReceiveNum',
    label: '待收货数量',
    width: 120
    // formatter: row => row['awaitReceiveNum'] + `/箱`
    // formatter: row => `${row.awaitReceiveNum && row.unit ? `${row.awaitReceiveNum}/${row.unit}` : row.awaitReceiveNum || row.unit ? row.awaitReceiveNum : ''}`
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  // {
  //   prop: 'externlCode',
  //   label: '医院产品编码',
  //   width: 120,
  //   'show-overflow-tooltip': true
  // },
  // {
  //   prop: 'hospitalProdName',
  //   label: '产品名称',
  //   width: 120
  // },
  // {
  //   prop: 'specification',
  //   label: '产品规格',
  //   width: 120,
  //   'show-overflow-tooltip': true
  // },
  // {
  //   prop: 'specification',
  //   label: '产品型号',
  //   width: 120
  // },
  {
    prop: 'provinceProductCode',
    label: '省平台编码',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'platCode',
    label: '平台产品编码',
    width: 200,
    'show-overflow-tooltip': true
  }

  // {
  //   prop: 'storageCondition',
  //   label: '存储条件',
  //   'min-width': 120
  // }
]
// 展开组件的父列表表头(待确认,已取消,待收货,已拒绝)
export const cardConfirmedColumns = [
  { width: '40', prop: 'placeholder', fixed: 'left', type: 'expand' },
  {
    prop: 'deliveryItemCode',
    label: '发货明细单号',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'orderItemCode',
    label: '关联采购单明细编号',
    'min-width': 160,
    'show-overflow-tooltip': true
  },
  { prop: 'itemCode', label: '产品编码', 'min-width': 150 },
  { prop: 'nameCn', label: '产品名称', width: 150 },
  { prop: 'specification', label: '规格', width: 150 },
  { prop: 'productType', label: '型号', width: 150 },
  {
    prop: 'category',
    label: '产品大类',
    width: 150,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  // { prop: 'certificateNo', label: '批号', width: 170 },
  { prop: 'manufacturer', label: '生产厂家', width: 150 },
  {
    prop: 'price',
    label: '单价(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  { prop: 'registrationNumber', label: '注册证号/备案证号', width: 150 },
  { prop: 'purchaseNum', label: '采购数量', width: 150 },
  { prop: 'sendNum', label: '发货数量', width: 150 },
  { prop: 'minUnit', label: '计量单位', width: 150 },
  { prop: 'platCode', label: '平台编码', width: 150 },
  { prop: 'itemBillNumber', label: '发票编号', width: 150 }
]

// 展开组件的父列表表头(部分收货)
export const cardPartialCollectionColumns = [
  // { width: '40', prop: 'placeholder', fixed: 'left', type: 'expand' },
  { prop: 'receiveItemCode', label: '采购明细单号', width: 150 }, // 1
  { prop: 'companyProdCode', label: '产品编码', width: 150 }, // 1
  { prop: 'nameCn', label: '产品名称', 'min-width': 150 }, // 1
  { prop: 'specification', label: '规格', width: 150 },
  { prop: 'productType', label: '型号', width: 150 },
  { prop: 'unit', label: '最小单位', width: 150 },
  {
    prop: 'price',
    label: '单价(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  { prop: 'registrationNumber', label: '注册证号/备案证号', width: 150 },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    'min-width': 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 150,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  { prop: 'sendNum', label: '采购数量', width: 150 }, // 1
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  { prop: 'platCode', label: '平台产品编码', width: 150 },
  { prop: 'itemReceiptNum', label: '已收货数量', width: 150 }, // 1
  { prop: 'itemReceiptNum', label: '待收货数量', width: 150 } // 1
  // { prop: 'minUnit', label: '计量单位', width: 150 },
  // { prop: 'itemCheckNum', label: '质检异常数', width: 150 },

  // { prop: 'storageCondition', label: '存储条件', width: 150 },
  // { prop: 'provinceProductCode', label: '省平台产品编码', width: 150 },

]
// 展开组件的父列表表头(已完成)
export const cardCompletedColumns = [
  // { width: '40', prop: 'placeholder', fixed: 'left', type: 'expand' },
  { prop: 'receiveItemCode', label: '收货明细单号', width: 150, 'show-overflow-tooltip': true },
  { prop: 'receiveItemCode', label: '关联明细单号', width: 150, 'show-overflow-tooltip': true }, // 1
  { prop: 'itemCode', label: '产品编码', width: 150, 'show-overflow-tooltip': true },
  { prop: 'nameCn', label: '产品名称', 'min-width': 150, 'show-overflow-tooltip': true }, // 1
  { prop: 'specification', label: '规格', width: 150, 'show-overflow-tooltip': true },
  { prop: 'productType', label: '型号', width: 150, 'show-overflow-tooltip': true },
  { prop: 'unit', label: '最小单位', width: 150 },
  {
    prop: 'price',
    label: '单价(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  { prop: 'registrationNumber', label: '注册证号/备案证号', width: 150, 'show-overflow-tooltip': true },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    'min-width': 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 150,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  // { prop: 'itemCode', label: '产品编码', 'min-width': 150 }, // 1
  { prop: 'purchaseNum', label: '采购数量', width: 150 }, // 1
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  { prop: 'platCode', label: '平台产品编码', width: 150, 'show-overflow-tooltip': true },
  { prop: 'receiveNum', label: '收货数量', width: 150, 'show-overflow-tooltip': true } // 1

  // { prop: 'batch', label: '批号', width: 170 },

  // { prop: 'minUnit', label: '计量单位', width: 150 },
  // { prop: 'itemCheckNum', label: '质检异常数', width: 150 },

  // // { prop: 'storageCondition', label: '存储条件', width: 150 },
  // { prop: 'provinceProductCode', label: '省平台产品编码', width: 150 },

]
export const dialogCardCompletedColumns = [
  { prop: 'itemCode', label: '产品编码', width: 150, 'show-overflow-tooltip': true },
  { prop: 'nameCn', label: '产品名称', 'min-width': 150, 'show-overflow-tooltip': true }, // 1
  { prop: 'specification', label: '规格', width: 150, 'show-overflow-tooltip': true },
  { prop: 'productType', label: '型号', width: 150, 'show-overflow-tooltip': true },
  { prop: 'unit', label: '最小单位', width: 150 },
  {
    prop: 'price',
    label: '单价(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  { prop: 'registrationNumber', label: '注册证号/备案证号', width: 150, 'show-overflow-tooltip': true },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    'min-width': 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 150,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  // { prop: 'itemCode', label: '产品编码', 'min-width': 150 }, // 1
  { prop: 'purchaseNum', label: '采购数量', width: 150 }, // 1
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  { prop: 'platCode', label: '平台产品编码', width: 150, 'show-overflow-tooltip': true },
  { prop: 'receiveNum', label: '收货数量', width: 150, 'show-overflow-tooltip': true } // 1

  // { prop: 'batch', label: '批号', width: 170 },

  // { prop: 'minUnit', label: '计量单位', width: 150 },
  // { prop: 'itemCheckNum', label: '质检异常数', width: 150 },

  // // { prop: 'storageCondition', label: '存储条件', width: 150 },
  // { prop: 'provinceProductCode', label: '省平台产品编码', width: 150 },

]
// 展开组件的子列表表头(待确认,已取消,待收货,已拒绝)
export const cardSonConfirmedColumns = [
  { type: 'index', label: '序号', width: 80 },
  { prop: 'barCode', label: '主码', width: 150 },
  { prop: 'productDate', label: '生产日期', width: 150 },
  { prop: 'expDate', label: '有效期', width: 150 },
  { prop: 'productBatch', label: '批号', width: 150 },
  { prop: 'serialNumber', label: '序列号', width: 150 },
  { prop: 'udi', label: 'UDI', 'min-width': 150 },
  { prop: 'num', label: '数量', width: 150 }
]
// 展开组件的子列表表头(部分收货)
export const cardSonPartialCollectionColumns = [
  { type: 'index', label: '序号', width: 150 },
  { prop: 'udi', label: 'UDI', width: 150 },
  { prop: 'barCode', label: '主条码', width: 150 },
  { prop: 'productBatch', label: '批号', width: 150 },
  { prop: 'productDate', label: '生产日期', width: 150 },
  { prop: 'expDate', label: '有效期', width: 150 },
  { prop: 'serialNumber', label: '序列号', width: 150 },
  { prop: 'num', label: '数量', width: 150 },
  { prop: 'entryNumd', label: '条码图片', width: 150 }
]
// 展开组件的子列表表头(已收货)
export const cardSonCompletedColumns = [
  { type: 'index', label: '序号', width: 150 },
  { prop: 'udi', label: 'UDI', width: 150 },
  { prop: 'barCode', label: '主条码', width: 150 },
  { prop: 'productBatch', label: '批号', width: 150 },
  { prop: 'productDate', label: '生产日期', width: 150 },
  { prop: 'expDate', label: '有效期', width: 150 },
  { prop: 'serialNumber', label: '序列号', width: 150 },
  { prop: 'num', label: '数量', width: 150 },
  { prop: 'entryNumd', label: '条码图片', width: 150 }
]
// 父子级列表标题
export const ReceivingTitle = [
  {
    label: '收货单号',
    key: 'receiveCode'
  },
  {
    label: '收货时间',
    key: 'createdAt'
  },
  {
    label: '发货数量',
    key: 'deliverySum'
  },
  {
    label: '收获数量',
    key: 'receiveSum'
  }
]
// 弹框列表表头
export const dialogColumns = [
  {
    type: 'index',
    label: '序号',
    width: 40
  },
  {
    prop: 'platCode',
    label: '产品通用编码',
    width: 200
  },
  {
    prop: 'companyCode',
    label: '产品名称',
    width: 200,
    'show-overflow-tooltip': true
  },

  {
    prop: 'prodNameCn',
    label: '产品名称(英)',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'prodNameEn',
    label: '规格',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'registNo',
    label: '单位',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'bigType',
    label: '数量',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'status',
    label: '生产批号',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'Ordertime',
    label: '生产日期',
    width: 120
  },
  {
    prop: 'registNo',
    label: '有效期',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'bigType',
    label: '注册证号/备案证号',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'status',
    label: '生产企业',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'Ordertime',
    label: '生产企业许可证号',
    width: 120
  }
  // {
  //   prop: 'ops',
  //   label: '存储条件',
  //   'min-width': 120,
  //   fixed: 'right'
  // }
]

// 弹框列表详情
export const dialogdetails = [
  {
    label: '开票员',
    key: ''
  },
  {
    label: '发货员',
    key: ''
  },
  {
    label: '复核员',
    key: ''
  },
  {
    label: '签收员',
    key: ''
  },
  {
    label: '地址',
    key: ''
  },
  {
    label: '电话',
    key: ''
  }
]
// 质检

// 收获

// 订单信息title
export const orderheadercolumns = [
  ...partialCollectionColumns
]
// 提交订单信息表头
export const orderreleasecolumns = [
  {
    type: 'index',
    label: '序号',
    width: 80
  },
  {
    prop: 'orderItemCode',
    label: '采购明细单号',
    width: 180,
    'show-overflow-tooltip': true
  },
  {
    prop: 'itemCode',
    label: '产品编码',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    'min-width': 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    width: 80
  },
  {
    prop: 'productType',
    label: '型号',
    width: 80
  },
  {
    prop: 'unit',
    label: '最小单位',
    width: 100
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 80,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 180,
    'show-overflow-tooltip': true
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 120,
    'show-overflow-tooltip': true
  },

  {
    prop: 'category',
    label: '产品大类',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },

  {
    prop: 'purchaseNum',
    label: '数量',
    width: 80
  },

  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  {
    prop: 'platCode',
    label: '平台产品编码',
    width: 140,
    'show-overflow-tooltip': true
  }
]
// 发货信息title    提交关联采购单号
export const deliveryheadercolumns = [
  {
    label: '发货单号',
    key: 'deliveryCode'
  },
  {
    label: '关联采购单号',
    key: 'saleOrderCode'
  },
  {
    label: '发货时间',
    key: 'createdAt'
  },
  {
    label: '发货人',
    key: 'deliveryName'
  },
  {
    label: '关联发票编号',
    key: 'billNumber'
  }
]
// 待发货title
export const subDeliverorderheadercolumns = [
  {
    label: '发货单号',
    key: 'platCode'
  },
  {
    label: '关联采购单号',
    key: 'registNo'
  },
  {
    label: '发货时间',
    key: 'spec'
  },
  {
    label: '发货人',
    key: 'manufacturer'
  },
  {
    label: '关联发票编号',
    key: 'model'
  }
]
// -------------------质检--------------------
// 列表--列表表头
export const qualityTestingTableData = [
  { width: '40', prop: 'placeholder', fixed: 'left', type: 'expand' },
  {
    prop: 'deliveryItemCode',
    label: '收货明细编码',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'orderItemCode',
    label: '关联发货明细编码',
    width: 190,
    'show-overflow-tooltip': true
  },
  {
    prop: 'itemCode',
    label: '产品编码',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    'min-width': 130,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    'min-width': 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    'min-width': 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 100,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    'min-width': 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  { prop: 'registrationNumber', label: '注册证号/备案证号', width: 150 },
  { prop: 'purchaseNum', label: '采购数量', width: 100 },
  // { prop: 'sendNum', label: '已收货数量', width: 180 },
  { prop: 'sendNum', label: '发货数量', width: 100 },
  { prop: 'itemCheckNum', label: '质检异常数量', width: 150 },
  { prop: 'minUnit', label: '计量单位', width: 100 },
  {
    prop: 'platCode',
    label: '平台编码',
    width: 180,
    'show-overflow-tooltip': true
  },
  { prop: 'itemBillNumber', label: '发票编号', width: 120 }
]
export const receivingGoodsItemArr = [
  { type: 'index', label: '序号', width: 56 },
  { prop: 'udi', label: 'UDI', width: 150, 'show-overflow-tooltip': true },
  { prop: 'barCode', label: '主条码', width: 190, 'show-overflow-tooltip': true },
  {
    prop: 'productBatch',
    label: '批号',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'erialNumber',
    label: '序列号',
    width: 130,
    'show-overflow-tooltip': true
  },
  { prop: 'productDate', label: '生产日期', width: 100 },
  { prop: 'expDate', label: '有效期', width: 100 },
  { prop: 'num', label: '发货数量', width: 100 },
  { prop: 'checkNum', label: '质检异常数量', width: 150 },
  { prop: 'purchaseNum', label: '备注', width: 100 },
  { prop: 'action', label: '操作', width: 300 }
]
// ------------------------收货------------------
export const receivingGoodsTableData = [
  { width: '40', prop: 'placeholder', fixed: 'left', type: 'expand' },
  {
    prop: 'deliveryItemCode',
    label: '收货明细编码',
    width: 110,
    'show-overflow-tooltip': true
  },
  {
    prop: 'orderItemCode',
    label: '关联发货明细编码',
    width: 190,
    'show-overflow-tooltip': true
  },
  {
    prop: 'itemCode',
    label: '产品编码',
    width: 130,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    'min-width': 130,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    'min-width': 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    'min-width': 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 90,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    'min-width': 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  { prop: 'registrationNumber', label: '注册证号/备案证号', width: 100 },
  { prop: 'purchaseNum', label: '采购数量', width: 100 },
  { prop: 'itemReceiveNum', label: '已收货数量', width: 130 },
  { prop: 'sendNum', label: '发货数量', width: 100 },
  { prop: 'itemCheckNum', label: '质检异常数量', width: 130 },
  { prop: 'itemReceivableNum', label: '应收数量', width: 100 },
  { prop: 'itemReceiptNum', label: '实收数量', width: 100 },
  { prop: 'minUnit', label: '计量单位', width: 90 },
  {
    prop: 'platCode',
    label: '平台编码',
    width: 150,
    'show-overflow-tooltip': true
  },
  { prop: 'itemBillNumber', label: '发票编号', width: 120 },
  { prop: 'action', label: '操作', width: 100, fixed: 'right' }
]
export const receivingGoodsItemColumns = [
  { type: 'index', label: '序号', width: 56 },
  { prop: 'udi', label: 'UDI', width: 100, 'show-overflow-tooltip': true },
  { prop: 'barCode', label: '主条码', width: 100, 'show-overflow-tooltip': true },
  {
    prop: 'productBatch',
    label: '批号',
    width: 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'erialNumber',
    label: '序列号',
    width: 100,
    'show-overflow-tooltip': true
  },
  { prop: 'productDate', label: '生产日期', width: 100 },
  { prop: 'expDate', label: '有效期', width: 100 },
  { prop: 'num', label: '发货数量', width: 100 },
  { prop: 'checkNum', label: '质检异常数量', width: 130 },
  { prop: 'receivableNum', label: '应收数量', width: 100 },
  { prop: 'receiptNum', label: '实收数量', width: 100 }
]
export const dialogColumnsList = [
  {
    prop: 'itemCode',
    label: '产品编码',
    width: 130,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    width: 130,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    width: 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    width: 100,
    'show-overflow-tooltip': true
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    'min-width': 200,
    'show-overflow-tooltip': true
  },
  {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 180,
    'show-overflow-tooltip': true
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.detailAmount)
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 90,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  { prop: 'sendNum', label: '发货数量', width: 90 },
  { prop: 'itemCheckNum', label: '质检异常数量', width: 150 },
  { prop: 'itemReceivableNum', label: '应收数量', width: 100 },
  { prop: 'itemReceiptNum', label: '实收数量', width: 100 },
  {
    prop: 'platCode',
    label: '平台编码',
    width: 180,
    'show-overflow-tooltip': true
  }
]
